package net.csdn.business.kanban.common.utils;

import cn.hutool.core.bean.BeanUtil;
import net.csdn.business.kanban.common.domain.PageDto;

/**
 * @ClassName CommonConverter
 * @Description TODO
 * @Author liuzhisheng
 * @Date 2023/9/20
 **/
public class CommonConverter {
    public static <S, D> PageDto<D> transferPageListEntity(PageDto<S> page, Class<D> targetType) {
        return PageDto.build(BeanUtil.copyToList(page.getContent(), targetType), page.getPageNum(), page.getPageSize(), page.getTotal());
    }
}